<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <h2>{{person.name}}--{{person.age}}</h2>
        <h3>{{person.fav}}</h3>
        <ul>
            <li>1</li>
            <li>2</li>
            <li>3</li>
        </ul>
        <h3>{{msg}}</h3> 
        <div v-text='msg'></div> 
        <div v-text='person.fav'></div>
        <div v-text='person.sex'></div>
        <div v-text='person.habit.a'></div>
        <div v-html='htmlStr'></div>
        <input type="text" v-model='msg'></input>
        <input type="text" v-model='person.fav'></input>
        <button v-on:click='handlerClick'>on按钮</button>
        <button @click='handlerClick'>@按钮</button>
    </div>
    <script src="./Observer.js"></script>
    <script src="./MVue.js"></script>
    <script>
        let vm = new MVue({
            el: '#app',
            data: {
                person: {
                    name: "小仙女",
                    age: '18',
                    fav: '姑娘',
                    sex:'女',
                    habit:{
                        a:'吃',
                        b:'喝',
                    }
                },
                msg: '学习MVVM实现原理',
                htmlStr: '<h3>大家好，你们学的怎么样？<h3>'
            },
            methods: {
                handlerClick() {
                    // console.log(this)
                    this.person.name = '学习让人开心！'  //如果想这样改可以 需要数据代理
                }
            },

        })
    </script>

</body>

</html>